import { request } from "@/utils/request.js";

// 问卷-获取问卷
const getQaShow = () => {
    return request({
        url: "api/qa/show",
        method: "GET",
    });
};

// 问卷-完成问卷
const setQaAnswer = (params) => {
    return request({
        url: "api/qa/answer",
        method: "POST",
        data: params
        // {
        //     q_id:11,
        //     'answers[0][qqa_id]':205,
        //     'answers[0][question_id]':201,
        //     'answers[0][answer_id]':201,
        //     'answers[0][value]':1,
        // }

    });
};
// 问卷-是否需要完成问卷
// ps：完成过任意次数问卷，都会返回false，未完成过问卷返回true
const getNeedAnswer = () => {
    return request({
        url: "api/qa/needAnswer",
        method: "GET",
    },false);
};

module.exports = {
    getQaShow,
    setQaAnswer,
    getNeedAnswer
};
